﻿using System;

namespace Com.OpenCode.DwgConvert
{
    /// <summary>
    /// 日志组件
    /// </summary>
    public static class LogService
    {
        /// <summary>
        /// 日志信息回调接口
        /// </summary>
        public static ILogCallBack LogCallBack { get; set; }

        public static void ShowInfo(string context)
        {
            AlertMessage(context);
            if (LogCallBack != null)
            {
                LogCallBack.ShowInfo(context);
            }
        }

        public static void ShowWaring(string context)
        {
            AlertWraing(context);
            if (LogCallBack != null)
            {
                LogCallBack.ShowWaring(context);
            }
        }

        public static void ShowError(string context, Exception exception)
        {
            AlertError(context);
            if (LogCallBack != null)
            {
                LogCallBack.ShowError(context);
            }
        }

        public static void ShowError(string context)
        {
            ShowError(context, null);
        }

        /// <summary>
        /// 显示信息
        /// </summary>
        /// <param name="message"></param>
        public static void AlertMessage(string message)
        {

        }

        /// <summary>
        /// 显示警告信息
        /// </summary>
        /// <param name="message"></param>
        public static void AlertWraing(string message)
        {

        }


        /// <summary>
        /// 显示错误信息
        /// </summary>
        /// <param name="message"></param>
        public static void AlertError(string message)
        {

        }
    }
}
